<!DOCTYPE html>
<html>
<head>
    <title>处方延伸详情</title>
    <%- include('../../../_global/baseLibs') %>

    <style>
        body{
            font-size: 14px;
        }
        .wl-summary-box{
            position: relative;
            padding: 0.8rem 0rem;
            background: #FFFFFF;
            opacity: 0.7;
        }
        .wl-summary-box img{
            position: absolute;
            top: 50%;
        }
        .wl-summary-box p{
            font-size: 14px;
            line-height: 1.7rem;
            color: #32A2F8;
            margin-left: 7rem;
        }
        .wlsj{
            font-size: 12px!important;
        }
        .img-wlxc{
            width: 2.9rem;
            height: 1.35rem;
            left: 3rem;
            margin-top: -0.7rem;
        }
        .img-right{
            width: 0.8rem;
            height: 1.5rem;
            right: 1rem;
            margin-top: -0.8rem;
        }
        .dzxx-box, .kfxx-box{
            border-top: 1px dashed #C8C8C8;
            background: #FFFFFF;
            padding: 0.5rem 1.2rem;
        }
        .data-line-box label{
            color: #ADADAD;
            letter-spacing: 0;
            display: inline-block;
            width: 5.5rem;
        }
        .yplb-box{
            margin-top: 0.7rem;
            background: #ffffff;
        }
        .yplb-title-box{
            padding: 0.7rem 1.2rem;
        }
        .yplb-box span{
            font-size: 14px;
            line-height: 1.4rem;
        }
        .ypxx-item{
            border-top: 1px dashed #C8C8C8;
        }
        .ypxx-ypmc{
            margin: 0.5rem 0.5rem 0rem 1.1rem;
        }
        .ypxx-ypmc img{
            width: 1.05rem;
            height: 1.15rem;
            margin-bottom: 0.3rem;
        }
        .ypxx-ypmc span{
            margin-left: 0.3rem;
            color: #333333;
        }
        .ypxx-detail{
            padding: 0.5rem 1.2rem;
        }
        .ypxx-detail label{
        }
        .ypxx-detail span{
            color: #333333;
        }
    </style>
    <script>
        var page_cfys_detail = (function($, page_cfys_detail) {

            var cfg_def = {

            }
            page_cfys_detail.init = function(cfg){
                initView();
            }

            function initView(){
                $(".wl-summary-box").on('click', function(){
                    $.pageSwitch.goToUrl('yscf', 'detail_wl');
                })
            }
            return page_cfys_detail;
        })(jQuery, {})
    </script>
</head>
<body>
<div class="link wl-summary-box">
    <img class="img-wlxc" src="/static/images/qyfw/wlxf-small.png">
    <p id="address"></p>
    <p id="status"></p>
    <p id="wlsj"></p>
    <!--<p>暂无物流信息</p>-->
    <img class="img-right" src="/static/images/back.png">
</div>
<div class="dzxx-box">
    <div class="data-line-box">
        <label>送货方式</label>
        <span class="shfs">送货上门</span>
    </div>
    <div class="data-line-box">
        <label>送货地址</label>
        <span class="shdz"></span>
    </div>
</div>
<div class="kfxx-box">
    <div class="data-line-box">
        <label>开方医院</label>
        <span class="hosName"></span>
    </div>
    <div class="data-line-box">
        <label>开方日期</label>
        <span class="cfDate"></span>
    </div>
</div>
<div class="yplb-box">
    <div class="yplb-title-box">
        <span>药品列表</span>
    </div>
    <ul id="list"></ul>
</div>
</body>
<script>
    (function () {
        var obj =JSON.parse(sessionStorage.getItem('cfInfo'));
        $.QuickRemote.AjaxJson({//获取
            funcName: "/api/gzd/shbus/queryCFDetail"
            ,params: obj
            ,callback: function(result) {
                var html = ''
                var shfs = (result[0].shfs == 1)? '自提': '送货上门'
                $('.shdz').text(result[0].hzshdz || '')
                sessionStorage.setItem('shdz',result[0].hzshdz)
                $('.shfs').text(shfs)
                $('.cfDate').text(result[0].kfrq || '')
                $('.hosName').text(result[0].yljgmc || '')
                for(var i=0;i<result.length;i++){
                    var wl = result[i]
                    html += '<li class="ypxx-item">\n' +
                        '            <div class="ypxx-ypmc">\n' +
                        '                <img src="/static/images/qyfw/ypxx-small.png">\n' +
                        '                <span>'+wl.ypmc+'</span>\n' +
                        '            </div>\n' +
                        '            <div class="ypxx-detail">\n' +
                        '                <div class="data-line-box">\n' +
                        '                    <label>单价数量</label>\n' +
                        '                    <span>'+wl.cgdj+'*'+wl.ypsl+wl.bzdw+'</span>\n' +
                        '                </div>\n' +
                        '                <div class="data-line-box">\n' +
                        '                    <label>药品规格</label>\n' +
                        '                    <span>'+wl.gg+'/'+wl.bzdw+'</span>\n' +
                        '                </div>\n' +
                        '                <div class="data-line-box">\n' +
                        '                    <label>用法用量</label>\n' +
                        '                    <span>'+wl.yfyl+'</span>\n' +
                        '                </div>\n' +
                        '            </div>\n' +
                        '        </li>'
                }
                $("#list").append(html);
                cfWl();
            }
        });
        function cfWl() {
            $.QuickRemote.AjaxJson({//处方物流
                funcName: "/api/gzd/shbus/prescriptionStatistics"
                ,params: obj
                ,callback: function(result) {
                    var wl = result[result.length-1];
                    var str = (wl.ddzt == 1 && '已开具延伸处方筏') || (wl.ddzt == 2 && '已结算收费') ||(wl.ddzt == 3 && '已审方')
                        ||(wl.ddzt == '3.1' && '已推送至药企') ||(wl.ddzt == 4 && '药企已接受延伸处方配送订单') ||(wl.ddzt == 5 && '药企已备货完成')
                        ||(wl.ddzt == 6 && '药企配送药品已出库') ||(wl.ddzt == 7 && '配送点/客户 已签收');
                    $('#status').text(str);
                    $('#wlsj').text(wl.rq);
                    sessionStorage.setItem('cfWl', JSON.stringify(result))
                }
            });
        }
    })()
</script>
</html>